import 'package:boss/textStyle/text_style.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

class DefaultFooter extends StatelessWidget {
  final TextStyle textStyle = TextStyleConstant().normal_4_26;

  @override
  Widget build(BuildContext context) {
    return CustomFooter(
      builder: (context, status) {
        Widget child;

        if (status == LoadStatus.loading) {
          child = Text(
            '正在加载',
            style: textStyle,
          );
        } else if (status == LoadStatus.noMore) {
          child = Text(
            '没有更多了～',
            style: textStyle,
          );
        } else if (status == LoadStatus.failed) {
          child = Text(
            '加载失败',
            style: textStyle,
          );
        } else if (status == LoadStatus.canLoading) {
          child = Text(
            '松开加载更多',
            style: textStyle,
          );
        } else if (status == LoadStatus.idle) {
          child = Text(
            '上拉加载更多',
            style: textStyle,
          );
        } else {
          child = Container();
        }

        return Container(
          alignment: Alignment.center,
          padding: EdgeInsets.symmetric(
            vertical: 15.w,
          ),
          child: child,
        );
      },
    );
  }
}
